﻿<div class="middlebg">
	<div id="component">
		<table class="contentpaneopen">
			<tbody>
				<tr>
					<td width="100%" class="contentheading">Tips Records</td>
				</tr>
			</tbody>
		</table>

		<table class="contentpaneopen">
			<tbody>
				<tr>
					<td valign="top" colspan="2">
						<?php foreach ($this->tipRecords as $year => $yearData) :?>
						<table width="640" border="0" style="">
							<tbody>
								<tr bgcolor="#e10707">
									<td width="16%" align="center" #9f9231="" solid="solid" 1px=""
										border:="border:""=""><font color="#ffffff"><strong>Period</strong>
									</font></td>
									<td width="16%" align="center" #9f9231="" solid="solid" 1px=""
										border:="border:""=""><font color="#ffffff"><strong>Win</strong>
									</font></td>
									<td width="16%" align="center" #9f9231"="" solid="solid" 1px=""
										border:="border:"><font color="#ffffff"><strong>Draw</strong>
									</font></td>
									<td width="16%" align="center" #9f9231="" solid="solid" 1px=""
										border:="border:""=""><font color="#ffffff"><strong>Lose</strong>
									</font></td>
									<td width="16%" align="center" #9f9231="" solid="solid" 1px=""
										border:="border:""=""><font color="#ffffff"><b>Hits</b> </font>
									</td>
									<td width="16%" align="center" #9f9231="" solid="solid" 1px=""
										border:="border:""=""><font color="#ffffff"><strong>Records</strong>
									</font></td>
								</tr>
								<?php foreach ($yearData as $month => $monthData) : ?>
								<tr>
									<?php 
										$this->date->set("$year $month", "YYYY MM"); 
										if(!isset($monthData["1"])) {
											$monthData["1"] = 0;
										}
										if(!isset($monthData["0"])) {
											$monthData["0"] = 0;
										}
										if(!isset($monthData["-1"])) {
											$monthData["-1"] = 0;
										}
									?>
									<td bgcolor="#CCCCCC" align="center"
										style="border: 1px solid #e10707"><?= $this->date->get("MMMM - YYYY") ?></td>
									<td bgcolor="#CCCCCC" align="center"
										style="border: 1px solid #e10707"><b><font color="#e10707"><?= $monthData["1"] ?></font>
									</b></td>
									<td bgcolor="#CCCCCC" align="center"
										style="border: 1px solid #e10707"><?= $monthData["0"] ?></td>
									<td bgcolor="#CCCCCC" align="center"
										style="border: 1px solid #e10707"><?= $monthData["-1"] ?></td>
									<td bgcolor="#CCCCCC" align="center"
										style="border: 1px solid #e10707"><font color="#e10707"><b><?php 
																										if($monthData["-1"] == 0) {
																											echo "100%";
																										} else if($monthData["1"] == 0) {
																											echo "0%";
																										} else {
																											echo printf("%.1f", $monthData["1"]/($monthData["1"] + $monthData["-1"])*100)."%";
																										}
																								 	?>
																								 </b>
									</font></td>
									<td bgcolor="#CCCCCC" align="center"
										style="border: 1px solid #e10707"><font color="#0000FF"><u>
											<a href="<?php echo $this->baseUrl('/site/tip-records-detail/year/'.$year."/month/".$month); ?>">
												<font color="#0000FF"><u>VIEW HERE</u> </font> 
											</a>
										</u> </font></td>
								</tr>
								
								<?php endforeach;  ?>
							</tbody>
						</table> 
						<br>			
						<?php endforeach; ?>
					</td>
				</tr>
			</tbody>
		</table>

		<span class="article_seperator">&nbsp;</span>

		<div class="back_button">
			<a href="javascript:history.go(-1)"> [ Back ]</a>
		</div>
	</div>

</div>
